// components/toast/toast.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    msg: {
      type: Object,
      observer: function(newval, oldval) {
        console.log(newval);
        this.setData({
          msg: newval
        })
      }
      
    },
    pupShow: {
      type: Boolean,
      observer: function(newval, oldval){
        // console.log(newval, oldval);
        // if()
        this.setData({
          show: newval
        })
      }
    }
  },

  /**
   * 组件的初始数据
   */
  data: {
    show: false,
    msg:{},
    res: {title: '暂无回复'}
  },

  /**
   * 组件的方法列表
   */
  methods: {
    notShow() {
      this.setData({
        show: false
      })
    },
    testClick(){
      //triggerEvent可以理解为vue中$emit
      this.triggerEvent("myevent","张三")
    }
  }
})
